﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TookKit.Mvvm.Enums;

namespace TookKit.Mvvm.Attributes
{
    /// <summary>
    /// 表示它所标注的类会被自动注册到IOC容器中
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class DependencyInjectionAttribute : Attribute
    {
        /// <summary>
        /// 生命周期
        /// </summary>
        public Lifetime Lifetime { get; set; }
        /// <summary>
        /// 类的基接口
        /// </summary>
        public Type[] InterfaceTypes { get; set; }
        public DependencyInjectionAttribute(Lifetime lifetime, params Type[] interfaceTypes)
        {
            Lifetime = lifetime;
            InterfaceTypes = interfaceTypes;
        }
    }
}
